# Maintainer: Felix Yan <felixonmars@archlinux.org>

pkgname=jrnl
pkgver=3.3
pkgrel=2
pkgdesc="Collect your thoughts and notes without leaving the command line"
arch=('any')
url="https://jrnl.sh/"
license=('GPL3')
depends=('python-ansiwrap' 'python-colorama' 'python-cryptography' 'python-keyring'
         'python-parsedatetime' 'python-dateutil' 'python-pyxdg' 'python-rich' 'python-ruamel-yaml'
         'python-tzlocal')
makedepends=('python-build' 'python-installer' 'python-poetry-core')
checkdepends=('python-pytest' 'python-pytest-bdd<6' 'python-toml')
source=("https://github.com/jrnl-org/jrnl/archive/v$pkgver/$pkgname-$pkgver.tar.gz")
sha512sums=('9484fc275d36f580e2b7a9ac017a4f26da37e18d9a48d2bbd41a339e6377e7240ed3400502f10e8a6eba1d42bf4730023d7dad1218c11394516cdf7e72b4ff0a')

prepare() {
  cd jrnl-$pkgver
  # https://github.com/pytest-dev/pytest-bdd/issues/501
  sed -i '/-n=auto/d' pyproject.toml
}

build() {
  cd jrnl-$pkgver
  python -m build -nw
}

check() {
  cd jrnl-$pkgver
  python -m pytest
}

package() {
  cd jrnl-$pkgver
  python -m installer --destdir="$pkgdir" dist/*.whl
}

# vim:set ts=2 sw=2 et:
